import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/views/Index'
import News from '@/views/News'
import Sports from '@/views/Sports'
import Basketball from '@/views/second/Basketball'
import Football from '@/views/second/Football'
import Pingpang from '@/views/second/Pingpang'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    component: Index
  },
  {
    path: '/news',
    component: News
  },
  {
    path: '/sports',
    component: Sports,
    children: [
      {
        path: 'basketball',
        component: Basketball
      },
      {
        path: 'football',
        component: Football
      },
      {
        path: 'pingpang',
        component: Pingpang
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
